<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="css/eui.css">
    <style>
        img{
            background-color: red;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="demo-image">
        <div class="block" v-for="fit in fits" :key="fit">
            <span class="demonstration">{{ fit }}</span>
            <el-image
                    style="width: 100px; height: 100px"
                    :src="url"
                    :fit="fit"></el-image>
        </div>
        <!--所有图片尺寸为200*200-->
        <h1>1. 保证图片完整显示并且不能变形</h1>
        <el-image style="width:200px;height: 200px" :src="url" fit="contain"></el-image>
        <h1>2. 保证图片完整显示</h1>
        <el-image style="width:200px;height: 200px" :src="url" fit="fill"></el-image>
        <h1>3. 保证图片宽高比并且占满200*200</h1>
        <el-image style="width:200px;height: 200px" :src="url" fit="cover"></el-image>
    </div>
</div>
</body>
<!-- import Vue before Element -->
<script src="js/vue.js"></script>
<!-- import JavaScript -->
<script src="js/eui.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function() {
            return {
                fits: ['fill', 'contain', 'cover', 'none', 'scale-down'],
                url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
            }
        }
    })
</script>
</html>